package com.example.myapplication;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;

import androidx.appcompat.app.AppCompatActivity;

public class LoginActivity2 extends AppCompatActivity {

    private Button btn_returnSign2;
    private RadioGroup radio_login;
    private RadioButton radio_yhmlogin,radio_sjhlogin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login2);

        radio_login = findViewById(R.id.radio_login);
        radio_yhmlogin = findViewById(R.id.radio_yhmlogin);
        radio_sjhlogin = findViewById(R.id.radio_sjhlogin);
        btn_returnSign2 = findViewById(R.id.btn_returnSign2);

        //        注册新用户
        btn_returnSign2.setOnClickListener((v)->{
            Intent intent = new Intent();
            intent.setClass(LoginActivity2.this,MainActivity.class);
            startActivity(intent);
        });

        radio_login.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int checkedId) {
                if(checkedId == R.id.radio_yhmlogin){
                    startActivity(new Intent(LoginActivity2.this,LoginActivity.class));
                }
            }
        });
    }
}